Keeps the Area of the overlay effect that is playing on an object: its top-left corner stays at the place where the object is on the screen, plus dx across and dy down, every frame, whatever the camera does. A heat haze over a campfire is overlay_area_follow(campfire, -16, -40). Call it after overlay_start.
Works differently on Game Boy - The Game Boy moves the Area every frame to stay on the object, in whole pixels, and leaves it where it was when the object is gone; the Area is kept to its rows as overlay_area says.
Works differently on Game Boy Color - The Game Boy Color moves the Area every frame to stay on the object, in whole pixels, and leaves it where it was when the object is gone; the Area is kept to its rows as overlay_area says.
Works differently on Sega Genesis - The Sega Genesis keeps a Wobble with an Area to the Area's rows, the whole width of the screen (the chip moves a whole line, so a box's sides are not cut), and this keeps those rows on an object; for an effect with no Area it does nothing (as on the Advance).
On other consoles this differs: see Side by side and How the consoles differ.
overlay_area_follow(target, dx, dy)| Name | Type |
|---|---|
target | ref<object> |
dx | int |
dy | int |
Nothing.
Keeps the Area of the playing overlay effect on an object. Every frame, the top-left corner of the Area is put where the object is on the screen, plus dx across and dy down. A heat haze over a campfire is overlay_area_follow(campfire, -16, -40): the haze starts 16 pixels to the left of the campfire and 40 above it, and it stays there while the camera moves.
dx and dy are plain offsets in pixels (positive is right and down), not places on the screen. If the object stops existing, the Area stays where it last was. overlay_area, or starting another effect, stops following.
Call it after overlay_start. It does nothing for an effect that has no Area.
An Area costs the console more than a plain effect, so use it sparingly: Overlay effects says what it costs.
overlay_start(ov_doc_flash);
overlay_area_follow(self, -16, -40);The effect starts and its Area follows this object, starting 16 pixels left of it and 40 above it.
The place is the object’s place in the room, taken from the camera’s place on every frame, so the Area stays over the object while the camera moves. dx and dy are plain offsets in pixels (positive is right and down), not places. If the object stops existing the Area stays where it last was. overlay_area, or starting another effect, stops following. It does nothing for an effect with no Area.